/*
 * @Descripttion:
 * @version:
 * @Author: sueRimn
 * @Date: 2020-10-15 10:21:43
 * @LastEditors: sueRimn
 * @LastEditTime: 2020-11-19 11:43:04
 */
import request from "@/utils/request";
import store from "@/store/index";

// 夹带k_token
function addK_Token(data) {
    var token = {
        k_token: store.getters.k_token
    };
    Object.assign(data, token);
    return data;
}

/**
 * 获取班级列表
 */
export function getGradeList(data) {
    return request({
        url: "/location_url/user/Grade.User/GradeList",
        method: "POST",
        headers: {},
        data: addK_Token(data)
    });
}

/**
 * 获取班级成员列表
 */
export function getGradeMemberList(data) {
    return request({
        url: "/location_url/user/Grade.User/GradeMember",
        method: "POST",
        headers: {},
        data: addK_Token(data)
    });
}

/**
 * 退出班级
 */
export function toGradeOut(data) {
    return request({
        url: "/location_url/user/Grade.User/GradeOut",
        method: "POST",
        headers: {},
        data: addK_Token(data)
    });
}

/**
 * 班级相册
 */
export function getGradePhoto(data) {
    return request({
        url: "/location_url/user/photo/listsPhoto",
        method: "POST",
        headers: {},
        data: addK_Token(data)
    });
}

/**
 * 班级相册
 */
export function getPhotoLists(data) {
    return request({
        url: "/location_url/user/photo/listsImg",
        method: "POST",
        headers: {},
        data: addK_Token(data)
    });
}

/**
 * 班级公告
 */
export function getNoticeLists(data) {
    return request({
        url: "/location_url/user/notice/listsNotice",
        method: "POST",
        headers: {},
        data: addK_Token(data)
    });
}

/**
 * 获取班级列表
 */
export function getGradeSearch(data) {
    return request({
        url: "/location_url/user/Grade.User/GradeSearch",
        method: "POST",
        headers: {},
        data: addK_Token(data)
    });
}

/**
 * 加入班级
 */
export function GradeJoin(data) {
    return request({
        url: "/location_url/user/Grade.User/GradeJoin",
        method: "POST",
        headers: {},
        data: addK_Token(data)
    });
}

/**
 * 撤销申请班级
 */
export function GradeRevoke(data) {
    return request({
        url: "/location_url/user/Grade.User/GradeApplyRevoke",
        method: "POST",
        headers: {},
        data: addK_Token(data)
    });
}

/**
 * 查看班级公告
 */
export function saveBrowseNum(data) {
    return request({
        url: "/location_url/user/notice/browseNum",
        method: "POST",
        headers: {},
        data: addK_Token(data)
    });
}
